<!--sidebar-menu-->
<div id="sidebar" class="clearfix"><!-- <a href="#" class="visible-phone"><i class="icon icon-home"></i> Dashboard</a> -->
    <ul style="display: block;">
        {% include "common/menu.html" %}
    </ul>
</div>
<!--end sidebar-menu-->

<div id="content" style="padding-bottom: 0px;min-height: auto;">

    <div class="container-fluid" style="padding: 0;">
        <div class="widget-box tab-tabs" >
            <div class="widget-title">
                <ul class="nav nav-tabs">
                    {% include "common/tab.html" %}
                </ul>
            </div>
            <div class="widget-content">

                <div id="tab2" class="tab-pane active" style="min-height: 898px;">
                    <div class="container-fluid" style="padding-top: 10px;">
                        {% include "common/pagination.html" %}
                        <div id="autoskip">

                            <ul id="exceptionList" class="thumbnails">

                            </ul>
                        </div>

                    </div>
                </div>

            </div>
        </div>

    </div>

</div>


<script type="text/javascript" src="{{static_url('web/js/jquery.fancybox-1.3.1.js')}}"></script>
<link rel="stylesheet" href="{{static_url('web/css/jquery.fancybox-1.3.1.css')}}" type="text/css" />
<script type="text/javascript">

    $(function(){

        getCoverList();



    });

    function getCoverList(index){

        var data={};
        data.page=index||1;
        data.pageSize=10;
        $.ajax({
            type:"POST",
            data:data,
            url:'/ajax/getCoverList',
            dataType:'json',
            success:function(res){
                var data=res.data;
                $('#exceptionList').html('');
                var count=global.doc('count');
                count.innerHTML=data.count;
                for (var i = 0; i <data.list.length; i++) {
                    $('#exceptionList').append(addRowGetCoverList(data.list[i]));
                };

                if(!index||index==0){
                    utilsPagination("#pagination",data.count,10,function(page_index, jq){
                        page_index+=1;
                        getCoverList(page_index);
                    });
                }
                $("a[rel=example_group]").fancybox({
                    'transitionIn'		: 'none',
                    'transitionOut'		: 'none',
                    'titlePosition' 	: 'over',
                    'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
                        return '<span id="fancybox-title-over" style="color: #000000">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
                    }
                });
            }

        });
    }
//    <a href="http://www.91ns.com/352" style="position: absolute;width: 100px;height: 30px;margin-left: -250px;"></a>
    function addRowGetCoverList(data){
        var html='';
        html+='<li class="GetCoverList"><div style="float: left;">';
        html+='<div class="thu-info"><a rel="example_group" href="'+data.imageUrl+'" title=""><img alt="" src="'+data.imageUrl+'" style="width: 250px;height: 150px;"></a>';
        html+='</div>';
        html+='<div class="clearfix"><div class="thu-use-info">';
        html+='<span>'+data.nickName+'</span></a>';
        html+='<span>'+ns_getAllTime(data.createTime)+'</span></div></div>';
        if(data.status==0){
            html+='<div style="width: 250px;">';
            html+='<div class="addrotbot pull-left" onclick="auditCover('+data.id+',1)"  style="width: 49.5%">通过</div>';
            html+='<div class="addrotbot pull-left" onclick="auditCover('+data.id+',2)"  style="width: 49.5%">不通过</div>';
            html+='</div>';
        }
        else{
            html+='<div class="AuditBox">';
            html+='<div class="_AuditBox">'+((data.status==1)?"已审核，通过":"已审核，不通过")+'<div class="_AuditBox-hover">';
            html+='<div class="_AuditBox-hover-info">';
            html+='<div class="_AuditBox-hover-info-box"></div>';
            html+='<table class="_Audit-table">';
            html+='<thead><tr>';
            html+='<td style="width: 58%">审核时间</td>';
            html+='<td style="width: 17%">审核人</td>';
            html+='<td class="noBorder" style="width: 24%">审核结果</td>';
            html+='</tr></thead>';
            html+='<tbody><tr>';
            html+='<td>'+ns_getAllTime(data.auditTime)+'</td>';
            html+='<td>'+data.auditor+'</td>';
            html+='<td class="noBorder">'+((data.status==1)?"通过":"不通过")+'</td>';
            html+='</tr></tbody></table></div></div></div></div>';
        }
        html+='</div></li>';

        return html;

    }

    function auditCover(id,status){
        var data={};
        data.id=id;
        data.status=status;
        $.ajax({
            type: "POST",
            data: data,
            url: '/ajax/auditCover',
            dataType: 'json',
            success: function (res) {
//                if(res.code==0){
                    alert(res.info);
                    location.reload();
//                }
            }
        })
    }


</script>